package com.hoas.quickstart.threads.chapter02.chapter02_3_1_01;

import com.sun.org.apache.xpath.internal.SourceTree;

public class PrintString {

    private boolean isContinuePrint = true;

    public boolean isContinuePrint() {
        return isContinuePrint;
    }

    public void setContinuePrint(boolean continuePrint) {
        isContinuePrint = continuePrint;
    }

    public void printStringMethod() {

        try {

            while (isContinuePrint == true) {
                System.out.println("run printStringMethod threadName="
                    + Thread.currentThread().getName());
                Thread.sleep(1000);
            }

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }

}
